package com.plian.system.controller.sys.fun;

import com.plian.Tools.pagedata.PageData;
import com.plian.system.model.ListResult;
import com.plian.system.model.ObjResult;
import com.plian.system.service.sys.fun.PerGroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 权限组/角色
 */
@RestController
@RequestMapping(value = "api/role")
public class PerGroupController {
    @Autowired
    PerGroupService perGroupService;
    @PostMapping(value = "/save")
    public ObjResult save(@RequestBody PageData pd) throws Exception {
        return perGroupService.save(pd);
    }
    @PostMapping(value = "/edit")
    public ObjResult edit(@RequestBody PageData pd) throws Exception {
        return perGroupService.edit(pd);
    }
    @PostMapping(value = "/findid")
    public ObjResult findid(@RequestBody PageData pd) throws Exception {
        return perGroupService.findbyid(pd);
    }
    @PostMapping(value = "/del_ids")
    public ObjResult delids(@RequestBody PageData pd) throws Exception {
        return perGroupService.delids((List<String>) pd.get("ids"));
    }
    @PostMapping(value = "/listpage")
    public ListResult<PageData> listpage(@RequestBody PageData pd) throws Exception {
        return perGroupService.listpage(pd);
    }
}
